<?php
    //styles
    XHTML::Style("
    	body {font-size: 62.5%;}
    	input.text {width: 100%; height: 22px;}
    	label {margin-top: 12px; display: block;}		
    	fieldset {padding: 0px; border: 0px;}
    	.validateTips {border: 1px solid transparent; padding: 0.3em; color: #FF0000 !important; text-align: center;}    
    ");

    //login box initiation
    jQuery::Dialog('login_box', array
        (
        	'modal' => 'true', 
        	'width' => '275',  
        	'resizable' => 'false', 
        	'draggable' => 'false', 
        	'buttons' => '{"'.Language::Get('login').'": function() {document.getElementById("login_form").submit();}}'
        )
    );

    //login box container
    echo "<div id = 'login_box' title = '".LANG_LOGIN."'>";

        //logo
        XHTML::Img(IMAGES.SEPARATOR.Settings::Get('logo'));

        //authentication error
        if ($this->data['error']) echo "<p class = 'validateTips ui-state-highlight'>{$this->data['error']}</p>";
    
        //login form
        XHTML::Form('/main/login/', 'POST', array('id' => 'login_form'));
            echo "<fieldset>";
                XHTML::InputTextBlock('login', $this->data['login'], LANG_LOGIN, array('field_attributes' => array('class' => 'text ui-widget-content ui-corner-all')), "<label>*label*</label>*field*");
                XHTML::InputPasswordBlock('password', $this->data['password'], LANG_PASSWORD, array('field_attributes' => array('class' => 'text ui-widget-content ui-corner-all')), "<label>*label*</label>*field*");
            echo "</fieldset>";
    	echo "</form>";
    
    echo "</div>";
?>